package com.aaa.three.conver;

import com.aaa.three.pojo.domain.AdminOffice;
import com.aaa.three.pojo.domain.AdminRole;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class AdminOfficeConverter implements Converter<AdminOffice> {

    @Override
    public Class supportJavaTypeKey() {
        return AdminOffice.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public AdminOffice convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
                                       GlobalConfiguration globalConfiguration) throws Exception {
        return null;
    }
    /**
     *  你的数据中有一个 adminOffice  是一个对象  哪个内容展示到 excel表格中
     * @param adminOffice
     * @param excelContentProperty
     * @param globalConfiguration
     * @return
     * @throws Exception
     */
    @Override
    public CellData convertToExcelData(AdminOffice adminOffice, ExcelContentProperty excelContentProperty,
                                       GlobalConfiguration globalConfiguration) throws Exception {
        return new CellData(adminOffice.getOname());
    }
}
